package com.cyt.web.controller.sys;

import com.cyt.base.enums.BusinessType;
import com.cyt.base.enums.OperatorType;
import com.cyt.base.model.dto.ReturnResult;
import com.cyt.sys.aspect.BaseLog;
import com.cyt.sys.model.vo.SysRoleRuleVo;
import com.cyt.sys.service.SysRoleRuleService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;


/**
 * 角色数据权限Controller实现类
 *
 * @author shengQiang yu
 * @date 2019-03-22 10:04
 */
@RestController
public class SysRoleRuleController extends SysBaseController {

    @Resource
    private SysRoleRuleService sysRoleRuleService;

    /**
     * 添加或修改
     *
     * @param sysRoleRuleVo Vo对象
     * @return
     * @author shengQiang yu
     * @date 2019-03-22 11:45
     */
    @BaseLog(module = "系统模块", classz = "数据管理", methods = "添加或修改", businessType = BusinessType.INSERT, operatorType = OperatorType.MANAGE)
    @RequestMapping(value = "/baseRoleRule/addOrUpdate", method = RequestMethod.POST)
    public ReturnResult addOrUpdate(SysRoleRuleVo sysRoleRuleVo) {
        ReturnResult baseRoleRule = sysRoleRuleService.addOrUpdate(sysRoleRuleVo);
        return baseRoleRule;

    }

}
